package com.bluegalaxy.nhb.domain.enums;

/**
 * @Auther: nanhb
 * @Date: 2020-03-18 10:53
 * @Description:
 */
public enum SqlOperEnum {

    LESS("less", "lessThan"),
    GATTER("gatter","moreThan"),
    EQUAL("equal","equal"),
    NOT_EQUAL("not equal","notEqual"),
    HAS_VALUE("has value","isNotNull"),
    NO_VALUE("no value","isNull"),
    NULL("null","isNull"),
    NOT_NULL("not null","isNotNull"),
    MATCH("match","notEqual"),
    NOT_MATCH("not match","notEqual"),
    RANGE("range","notEqual"),
    IN("in","in"),
    NOT_IN("not in","notIn"),

    DO("do","equal"),
    UNDO("undo","notEqual"),

    TRUE("true","true"),
    FALSE("false","false"),

    AND_ZN("且","and"),
    OR_ZN("或","or"),


    ;

    // 成员变量
    private String operCode;
    private String operValue;

    // 构造方法
    private SqlOperEnum(String operCode, String operValue) {
        this.operCode = operCode;
        this.operValue = operValue;
    }

    public static String getValue(String operCode) {
        for (SqlOperEnum c : SqlOperEnum.values()) {
            if (c.getOperCode().equals(operCode)) {
                return c.getOperValue();
            }
        }
        return null;
    }

    public String getOperCode() {
        return operCode;
    }

    public void setOperCode(String operCode) {
        this.operCode = operCode;
    }

    public String getOperValue() {
        return operValue;
    }

    public void setOperValue(String operValue) {
        this.operValue = operValue;
    }
}
